﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace Mimoza.Transport
{
    public class ThreadStore
    {
        const string DataSlotName = "Transport";

        static public void SetValue(string name, object val)
        {
            Thread.SetData( Thread.GetNamedDataSlot(DataSlotName), 
                val);
        }

        static public void ClearValue(string name)
        {
            SetValue(name, null);
        }

        static public bool IsExists(string name)
        {
            return (GetValue(name) != null);
        }

        static public object GetValue(string name)
        {
            return Thread.GetData(Thread.GetNamedDataSlot(DataSlotName));
        }

    }
}
